package com.sumansoul.bottomsheetdemo.adapter;

import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;


import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sumansoul.bottomsheetdemo.R;

import java.util.List;

public class MainAdapter extends BaseQuickAdapter<Integer, BaseViewHolder> {
    public MainAdapter(int layoutResId, @Nullable List<Integer> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, final Integer item) {

        RelativeLayout rl_item = helper.getView(R.id.rl_item);
        TextView tv_title = helper.getView(R.id.tv_title);
        tv_title.setText(item+"条目数");

        rl_item.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ToastUtils.showShort("点击："+item+"条目数");

            }
        });
    }
}
